﻿<Window x:Class="CncConvProg.View.Dialog.ArticoloCostiVariView"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:ab="clr-namespace:CncConvProg.View.AttachedProperty" xmlns:Resources="clr-namespace:MecPrev.Resources;assembly=MecPrev.Resources" 
        Title="{x:Static Resources:GuiRes.CostiAggiuntiviDlg}" 
        WindowStyle="ToolWindow"
        WindowState="Normal"
        Height="300"
        WindowStartupLocation="CenterScreen"
        >
    <Window.Resources>
        <Style TargetType="{x:Type ListViewItem}">
            <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
        </Style>
    </Window.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="177*" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <StackPanel>
            <TextBlock Text="--"/>
            <Button Content="{x:Static Resources:GuiRes.AddCost}" Command="{Binding Path=AddCostoVarioCmd}" Width="200" HorizontalAlignment="Left" Height="30" Margin="5"/>
            <ListView ItemsSource="{Binding Path=CostiAggiuntivi}" SelectionMode="Single" SelectedItem="{Binding Path=CostoAggiuntivoSelezionato}" Margin="5">
                <ListView.View>
                    <GridView>
                        <GridViewColumn Width="200" Header="{x:Static Resources:GuiRes.Description}" >
                            <GridViewColumn.CellTemplate>
                                <DataTemplate>
                                    <TextBox Text="{Binding Path=Descrizione}" ab:AutoSelectTextBox.AutoSelectText="True"  />
                                </DataTemplate>
                            </GridViewColumn.CellTemplate>
                        </GridViewColumn>
                        <GridViewColumn Header="{x:Static Resources:GuiRes.Total}" Width="150">
                            <GridViewColumn.CellTemplate>
                                <DataTemplate>
                                    <TextBox Text="{Binding Path=Importo}" ab:AttachedProperties.AutoSelectText="True"/>
                                </DataTemplate>
                            </GridViewColumn.CellTemplate>
                        </GridViewColumn>
                        <GridViewColumn Header="€/cad" Width="50">
                            <GridViewColumn.CellTemplate>
                                <DataTemplate>
                                    <CheckBox IsChecked="{Binding Path=IsImportoCad}" />
                                </DataTemplate>
                            </GridViewColumn.CellTemplate>
                        </GridViewColumn>
                        <GridViewColumn Header="€/Stock" Width="50">
                            <GridViewColumn.CellTemplate>
                                <DataTemplate>
                                    <CheckBox IsChecked="{Binding Path=IsImportoLotto}" />
                                </DataTemplate>
                            </GridViewColumn.CellTemplate>
                        </GridViewColumn>
                        <GridViewColumn>
                            <GridViewColumn.CellTemplate>
                                <DataTemplate>
                                    <Button Content="Del" Command="{Binding DataContext.DelCostiVariDetailCmd, RelativeSource={RelativeSource AncestorLevel=1, AncestorType={x:Type Window}, Mode=FindAncestor}}"
                                                CommandParameter="{Binding}" />
                                </DataTemplate>
                            </GridViewColumn.CellTemplate>
                        </GridViewColumn>
                    </GridView>
                </ListView.View>
            </ListView>
        </StackPanel>
        <StackPanel Orientation="Horizontal" Grid.Row="3" HorizontalAlignment="Right" Grid.ColumnSpan="2" >
            <Button Content="Cancel" Width="100" Margin="5" Click="Button_Click_1" />
            <Button Content="Ok" Width="100" Margin="5" Click="Button_Click" />
        </StackPanel>

    </Grid>
</Window>
